﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
/// <summary>
/// Summary description for Phukien
/// </summary>
public class Phukien
{
    public int Phukien_id { get; set; }
    public int DanhmucPhukien_id { get; set; }
    public string Name { get; set; }
    public string Url { get; set; }
    public string Description { get; set; }
    public float Price_input { get; set; }
    public float Price_output { get; set; }
    public bool Status { get; set; }
    public string Image { get; set; }
    public DateTime DateStart { get; set; }
    public DateTime DateUpdate { get; set; }
	public Phukien()
	{
	    this.Phukien_id = 0;
	    this.DanhmucPhukien_id = 0;
	    this.Name = "";
	    this.Url = "";
	    this.Description = "";
	    this.Price_input = 0;
	    this.Price_output = 0;
	    this.Status = true;
	    this.Image = "";
	    this.DateStart = DateTime.Now;
	    this.DateUpdate = DateTime.Now;
	}
    public Phukien(DataRow dr)
    {
        this.Phukien_id = Convert.ToInt32(dr[0].ToString());
        this.DanhmucPhukien_id = Convert.ToInt32(dr[1].ToString());
        this.Name = dr[2].ToString();
        this.Url = dr[3].ToString();
        this.Description = dr[4].ToString();
        this.Price_input = float.Parse(dr[5].ToString());
        this.Price_output = float.Parse(dr[6].ToString());
        this.Status = Boolean.Parse(dr[7].ToString());
        this.Image = dr[8].ToString();
        this.DateStart = DateTime.Parse(dr[9].ToString());
        if(dr[10].ToString()!="" && dr[10].ToString()!=null)
        {
            this.DateUpdate = DateTime.Parse(dr[10].ToString());
        }
    }
}